package com.lagou.module2_6;

/**
 * @author wsl
 * @date 2021/7/12 19:21
 * @project_name javase
 */
public class Manager {
    private String name;    //姓名
    private int id;         //工号
    private double salary;  //工资
    private double bonus;   //奖金

    //无参构造
    public Manager() {
    }

    //有参构造
    public Manager(String name, int id, double salary, double bonus) {
        setName(name);
        setId(id);
        setSalary(salary);
        setBonus(bonus);
    }

    //生成get\set方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
       if (id>0){
           this.id = id;
       }else{
           System.out.println("该项目经理的工号不合理哦！！！");
       }
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
       if (salary>=2000){
           this.salary = salary;
       }else{
           System.out.println("该项目经理的工资不合理！！！");
       }
    }

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        if(bonus>=0){
            this.bonus = bonus;
        }else{
            System.out.println("该项目经理的奖金不合理！！！");
        }
    }

    //声明一个成员方法work,用于记录该项目经理工作的行为
    public void work(int id,double salary,double bonus,String name){
        System.out.println("工号为"+id+"基本工资为"+salary+"奖金为"+bonus+"的项目经理"+name+"正在努力的做着" +
                "管理工作,分配任务,检查员工提交上来的代码.....");
    }
}
